<?php

!defined('IN_SYSTEM') && exit('Access denied');

class class_cache{

    public static function write($name,$value) {
        return @file_put_contents(CACHE_PATH.$name,@json_encode($value));
    }

    public static function read($name) {
        return @json_decode(file_get_contents(CACHE_PATH.$name),1);
    }

    public static function delete($name) {
        return @unlink(CACHE_PATH.$name);
    }

    public static function has($name) {
        return is_file(CACHE_PATH.$name);
    }
}